home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / cool / ge_cool.lha / GE_COOL2.1 / src / Tree / NT_State.h < prev    next >
C/C++ Source or Header  |  1992-04-30  |  2KB  |  54 lines

  1. //
  2. // Copyright (C) 1991 Texas Instruments Incorporated.
  3. //
  4. // Permission is granted to any individual or institution to use, copy, modify,
  5. // and distribute this software, provided that this complete copyright and
  6. // permission notice is maintained, intact, in all copies and supporting
  7. // documentation.
  8. //
  9. // Texas Instruments Incorporated provides this software "as is" without
  10. // express or implied warranty.
  11. //
  12. // Updated: VDN 02/21/92 -- Separate NT_State which must be implemented once
  13. //
  14.  
  15.  
  16. #ifndef N_TREE_STATEH                // If no definition for class
  17. #define N_TREE_STATEH
  18.  
  19. #ifndef STACKH                    // If no definition for class
  20. #include <cool/Stack.h>                // include definition file
  21. #endif
  22.  
  23. #ifndef PAIRH                    // If no definition for class
  24. #include <cool/Pair.h>                // include definition file
  25. #endif
  26.  
  27. DECLARE CoolPair<long,int>;            // Expand needed includes
  28. typedef CoolPair<long,int> CoolNT_Stack_Entry;
  29. DECLARE CoolStack<CoolPair<long,int>>;
  30. typedef CoolStack<CoolPair<long,int>> CoolNT_Stack;
  31.  
  32.  
  33. // Simple class that bundles an iterator stack with the direction 
  34. // of the traversal (forward or backward).  This is the current_position
  35. // state that can be saved and restored 
  36.  
  37. class CoolNT_State {                // State bundles Stack&Boolean
  38. public:
  39.   inline CoolNT_State () {};            // Simple constructor
  40.   CoolNT_State (const CoolNT_State& s);        // Copy constructor
  41.   inline ~CoolNT_State () {};            // Destructor
  42.   
  43.   CoolNT_State& operator= (const CoolNT_State& s); // overload = operator
  44.  
  45.   CoolNT_Stack stack;                // should be protected
  46.   Boolean forward;
  47. };
  48.  
  49. #endif                        // N_TREE_STATEH
  50.  
  51.  
  52.  
  53.  
  54.